import { ApplyTypeEnum } from '@/enums/membershipEnum';
import { MemberRoleEnum } from '@/enums/memberRoleEnum';
import { SexEnum, ThridTypeEnum } from '@/enums/loginEnum';
import { IsOfficialAccountEnum } from '@/enums/loginEnum';
import type { PagesType } from '@/router/types/pages';

export interface IGetPhoneNumber {
  iv?: string;
  code: string;
  encryptedData?: string;
  thridType: ThridTypeEnum;
}

export interface ILoginData {
  // phoneCode: string;
  // iv: string;
  code: string;
  // encryptedData: string;
  thridType: ThridTypeEnum;
}

export interface ILoginRes {
  token: string;
  // 是否有手机号
  isBind: boolean;
  // 用户唯一ID
  socialUserId: string;
  /** 租户id */
  tenantId: string;
  /** 公众号关注状态 */
  isOfficialAccount: IsOfficialAccountEnum;
  /** 用户信息 */
  appUser: IUserInfo
}

export interface CocInfo {
  id: number;
  orgCompanyId: number
  memberLeadingId: number
  cocId: number;
  cocName: string;
  cocOfficeTel: string;
  title: string;
  titleStr: string;
  name: string;
  companyName: string
  avatar: string;
  politicalStatus: string;
  politicalTitle: string;
  socialPosition: string;
  remarks: string;
  enabled: number;
  positionName: string;
  personalHonor: string;
  personalHonorList: string[];
  appUserId: number;
  briefIntroduction: string;
  videoUrl: string;
  show: number;
  levelId: number;
  cardStyle: string;
  phone: string;
  cocEmail: string;
  address: string;
  email: string;
  latitude: string;
  longitude: string;
  memberRoleType: MemberRoleEnum;
  applyType: ApplyTypeEnum;
  levelName: string;
  levelImageUrl: string
  iconUrl: string
  styleType: string
  memberEndTime: string
}

export interface MenuVoListItem {
  id: number
  menuKey: PagesType
  menuName: string
  parentId: number
}

export interface IUserInfo {
  userId: number;
  companyId: number
  companyName: string
  companyPosition: string
  loginName: string;
  userName: string;
  name: string
  phonenumber: string;
  avatar: string;
  wxOpenId: string;
  sysUserId: number;
  sex: SexEnum
  birthday: string
  schoolName: string
  wechatId: string
  email: string
  nativePlace: string
  nativePlaceStr: string
  /** 主库用户ID */
  mainUserId: number
  // 资料是否已完善
  isPerfectionInfo: boolean
  sysUser?: {
    userId: number;
    loginName: string;
    userName: string;
    avatar: string;
    phonenumber: string;
    menuVoList: MenuVoListItem[]
  };
  /** 公众号关注状态 */
  isOfficialAccount: IsOfficialAccountEnum;
  members: CocInfo[];
  imUserId?: string;
  userSig?: string;
  /** 已认证单位列表 */
  attestationCompanyIds: number[]
  /** 是否开启商城 */
  isOpenMall: boolean
  /** 用户分享的身份标识 */
  shareKey: string
  phone: string
  resource: string
  demand: string
}
